$setto(this,{$dom:{
  innerText: function(elm){
    var rtval = '';
    if(elm){
      if($oStr(elm.innerText)){
        rtval = elm.innerText;
      }else{
        for(var i=0,l=elm.childNodes.length; i<l; ++i){
          var childNode = elm.childNodes[i];
          switch (childNode.nodeType){
            case 1:
              rtval += this.innerText(childNode);
              break;
            case 3:
              rtval += childNode.nodeValue;
              break;
          }
        }
      }
    }
    return rtval;
  },
  renderHTML: function(elm, html, cb, cbargs){
    if($oStr($get(elm, "innerHTML"))){
        var f = function(){ elm.innerHTML = String(html); }
        $exea(f, [], cb, cbargs);
        f = null;
    }else if ($oStr(elm)){
        this.renderHTML($(elm), html, cb, cbargs);
    }
  },
  next: function(elm, tag){
    var n = elm.nextSibling;
    while(n && (n.nodeType != 1 || (tag && n.nodeName != tag))){
      n = n.nextSibling;
    }
    return n;
  },
  prev: function(elm, tag){
    var p = elm.previousSibling;
    while(p && (p.nodeType != 1 || (tag && p.nodeName != tag))){
      p = p.previousSibling;
    }
    return p;
  },
  parent: function(elm, tag){
    var p = elm.parentNode;
    while(p && (p.nodeType != 1 || (tag && p.nodeName != tag))){
      p = p.parentNode;
    }
    return p;
  },
  child: function(elm, tag, immediate){
    var elm = null, c;
    for(var i=0,l=elm.childNodes.length; !elm && i<l; ++i){
      c = elm.childNodes[i];
      if(c.nodeType == 1){
        if (!tag || c.nodeName == tag){
          elm = c;
        }
      }
    }
    if(!immediate){
      for(var i=0,l=elm.childNodes.length; !elm && i<l; ++i){
        c = elm.childNodes[i];
        if(c.nodeType == 1){
          elm = this.child(c, tag);
        }
      }
    }
    return elm;
  },
  forEach: function(func, parent, tag){
    if (!$oFun(func)){return;}
    for(var i = 0,l = parent.childNodes.length; i < l; ++i){
      var child = parent.childNodes[i];
      if (child.nodeType == 1 && (!tag || child.nodeName == tag)){
        if (func(child)){
          break;
        }
      }
    }
  },
  childCount: function(elm, tag){
    var count = 0;
    var child;
    for(var i=0,l=elm.childNodes.length; i < l; ++i){
      child = elm.childNodes[i];
      count += (child.nodeType == 1 && (!tag || child.nodeName == tag) ? 1 : 0);
    }
    return count;
  },
  addClass: function(elm, className){
    var rtval = elm.className;
    if (rtval){
      var newClasses = className.collapse().split(' ');
      var originalClasses = rtval.collapse().split(' ');
      for(var i=0,l=newClasses.length; i<l; ++i){
        var newClass = newClasses[i];
        if (!originalClasses.contains(newClass)){
          elm.className += ' ' + newClass;
        }
      }
    }
    else{
      elm.className = className;
    }
    return elm.className;
  },  
  delClass: function(elm, className){
    var rtval = elm.className;
    if(rtval){
      var classes = rtval.collapse().split(' ');
      var oldClasses = className.collapse().split(' ');
      for(var i = 0; i < oldClasses.length; ++i){
        classes.remove( oldClasses[i] );
      }
      var newValue = classes.join(' ');
      if (newValue != rtval){
        elm.className = newValue;
      }
    }
    return elm.className;
  },
  hasClass: function(elm, className){
    return elm.className.collapse().split(' ').contains(className);
  },
  getBrowserSize: function(){ 
    var intH=0, intW=0;
    if(typeof window.innerWidth == 'number'){ 
          intH = window.innerHeight;
          intW = window.innerWidth;
    }   
    else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){ 
            intH = document.documentElement.clientHeight; 
            intW = document.documentElement.clientWidth; 
    } 
    else if(document.body && (document.body.clientWidth || document.body.clientHeight)){ 
            intH = document.body.clientHeight; 
            intW = document.body.clientWidth; 
    } 
    return {width: parseInt(intW), height: parseInt(intH)};
  },
  getDisplay: function(elm){
    if (!elm || !elm.style) return undefined;
    return (elm.style.display != "none");
  },
  setDisplay: function(elm, vb){
      if (elm){
        try{
            vb = !!vb;
            elm.style.display = (vb ? "block" : "none");
        }catch(ex){}
      }
  },
  getVisibility: function(elm){
    if (!elm || !elm.style) return undefined;
    return (elm.style.visibility != "hidden");
  },
  setVisibility: function(elm, vb){
    if (elm)
    {
        try{
            vb = !!vb;
            elm.style.visibility = (vb ? "visible" : "hidden");
        }catch(ex){}
    }
  }
}});